import Vue from 'vue'
import Router from 'vue-router'
import Home from './../pages/Home/Home'
import Login from './../pages/Login/Login'
import ListArtical from '../components/article/ListArtical'
import CreateArtical from '../components/article/CreateArtical'
import EditArtical from '../components/article/editArtical'
import createList from '../components/shopList/createList'
import showList from '../components/shopList/showList'

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children:[
        {
          path: '/list',
          name: 'ListArtical',
          component: ListArtical
        },
        {
          path: '/create',
          name: 'CreateArtical',
          component: CreateArtical
        },
        {
          path: '/edit/:id',
          name: 'EditArtical',
          component: EditArtical
        },
        {
          path: '/createlist',
          name: 'createList',
          component: createList
        },
        {
          path: '/showlist',
          name: 'showList',
          component: showList
        },
      ]
    },
    {
      path: '/',
      redirect:'/login',
    },
  ]
})
